<? 
	$title="Upload Display Picture"; 
	$pageid="2";
	$accessid="a00";

	require("required/dbconnect.php"); 
	require("required/function.php");
	require("required/header.php");
	
		
	$id=$_GET['id'];
	$get_info=mysql_query("select * from os_sub_category where id=$id");
	
	if(mysql_num_rows($get_info)==0)
	{
		echo "No category found!!";
	}
	else
	{
		
		$a=mysql_fetch_array($get_info,MYSQL_ASSOC);
		
		$errormsg="";
?>
<table width="100%"  cellpadding="0" cellspacing="5" height="300">
	
	<td class="solidborder" width="84%" align="left" valign="top">
		<table width="100%">
			  <tr>
				<td height="20" colspan="7" align="left" style="background: url(images/tbl_th.png);color:#FFFFFF" ><font color="#FFFFFF"><strong>Upload Sub Category Picture</strong></font> </td>
			  </tr>
			  <?
						if($a["pic"]=="")
						{
							$pic="empty";
							$piclink="noimage.jpg";
							$fix="";
						}
						else
						{
							$piclink="subcat_".$a['id'].".gif";
							if($a["width"]-$a["height"]>0)
							{
								$fix="width=150";
							}
							else
							{
								$fix="height=150";
							}
						}	
				?>	
			  <tr valign="top">
				<tr>
						<td align="left">
						<img src="../subcat/<?= $piclink ?>" <?= $fix ?>>
						<br>
						(Please click <a href=# onClick="window.location.reload()"><font color="#FF6600">here</font></a> for the changes)</td>
				
					</tr>
				<form method="post" enctype="multipart/form-data" action="subcat_upload_pic2.php">
					<tr> 
						<td valign=top align="left"> 
						<font size=+1>Notice:</font>
						<ul>
						<li>The file size must less than 5MB</li>
						<li>must in jpg or gif format.</li>
						</ul>
						</td>
					</tr>
				<tr>
					<td>
					<font color=red><?= $errormsg ?></font><br>
					<input type="hidden" name="MAX_FILE_SIZE" value="5000000"> 
					  <input type="file" name="file" class=button><br>
					  <input type="hidden" name="hidid" value="<?= $id ?>">
					<br><br>
					  <input type="submit" value="upload" name=submit class=button> <input type="button" value="back" onclick="window.open('subcat_edit.php?id=<?= en_id($id) ?>','_self')" class=button> 
					</td>
				</tr>
			</table>
		</td>
				 
	</table>
<? } require("required/footer.php"); ?>
